document.write('<script src="http://connect.facebook.net/en_US/all.js"></script>');
var FB_LoginUrl= 'http://www.facebook.com/dialog/oauth?client_id=699473966748067&redirect_uri=http://www.c2life.com.vn/contest/OpenId&response_type=token&display=popup&scope=email,manage_pages,photo_upload,publish_actions,publish_stream,read_friendlists,status_update,user_birthday,user_photos,user_status,video_upload';
var windowInvite;
function FB_LOGIN(){
    window.open(FB_LoginUrl,'_blank','width=750,height=450,status=no,toolbar=no,menubar=no,location=no');
}

function fbLogin(){
    var obj = swfobject.getObjectById("swfcontent");
    
    if(obj && obj.loginSuccess) {
        obj.loginSuccess();
    }	
}

function login_openid(type){
    $.post(root+'users/link_login/'+type,function(data){
        window.open (data,type+'_login','menubar=0,resizable=1,width=600,height=500');
    });
}

function track(trackName){
	_gaq.push(['_trackPageview', trackName]);
}

function logText()
{
	console.log('abc');
}
function checkFirstTime(){

    var obj = swfobject.getObjectById("swfcontent");
    if(obj && obj.checkFirstTime) {
        obj.checkFirstTime();
    } 
}



function open_Popup_thanhcong(type){
    var obj = swfobject.getObjectById("swfcontent");
    if(obj && obj.open_Popup_Thongbao) {
        obj.open_Popup_Thongbao(type);
    } 
}
function close_Popup(type){
    $("#video").remove();
	type = type || '';
    var obj = swfobject.getObjectById("swfcontent");
    if(obj && obj.close_Popup) {
        obj.close_Popup(type);
    } 
}




function share_facebook(u,t,s,img) {
    var url="http://www.facebook.com/sharer.php?s=100&p[title]="+encodeURIComponent(t)+"&p[url]="+encodeURIComponent(u)+"&p[summary]="+encodeURIComponent(s)+"&p[images][0]="+encodeURIComponent(img);
    window.open(url);
    return false;
}




